<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('小夏1v1抽检详情列表')"/>
    <style>


        .W200 .th-inner {
            width:200px !important;
            padding-right: 0px !important;;
        }

        .send-content-wrap {
            white-space: pre-line;
            width: 500px;
            margin-right: 0;
            overflow: auto; /* 或者使用 overflow: visible; */
            word-wrap: break-word; /* 或者使用 word-break: break-word; */
        }

    </style>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">

            <form id="job-form">
                <div class="select-list">
                    <input type="hidden" id="batchCode" name="batchCode" th:value="${batchCode}">

                    <ul>
                        <li>
                            订阅id：<input type="text" name="unionid"/>
                        </li>
                        <li>
                            发送状态：<select name="status" th:with="type=${@dict.getType('send_job_status_type')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-responsive">
            <table id="bootstrap-table" class="table text‐wrap" data-resizable="true"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-resizable-js" />
<script th:inline="javascript">
    var sendJobStatusType = [[${@dict.getType('send_job_status_type')}]];
    var msgType = [[${@dict.getType('msg_type')}]];
    var prefix = ctx + "data/sampling/wx";

    $(function () {
        var options = {
            url: prefix + "/detail/list/"+$("#batchCode").val(),
            detailUrl: prefix + "/detail/{id}",
            sortName: "createTime",
            sortOrder: "desc",
            modalName: "wx数据抽检详情",
            columns: [
                {
                    field: 'id',
                    title: '主键',
                    visible:false
                },
                {
                    field: 'unionid',
                    title: '订阅id'
                },
                {
                    field: 'msgType',
                    title: '消息类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(msgType,value);
                    }
                },
                {
                    field: 'msgContent',
                    title: '内容',
                    formatter: function(value, row, index) {
                        return '<div class="send-content-wrap">' + value + '</div>';
                    }

                },
                {
                    field: 'sort',
                    title: '顺序',
                },
                {
                    field: 'status',
                    title: '发送任务状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(sendJobStatusType,value);
                    }
                },
                {
                    field: 'createTime',
                    title: '发送时间',
                    sortable: true
                },
                {
                    field: 'updateTime',
                    title: '更新时间',
                    sortable: true
                },
                ]
        };
        $.table.init(options);
    });

</script>
</body>
</html>